//go:generate go run github.com/ce-exp/backend/cli/gen-query --config=../../options/config.example.yml
package report

import (
	"path/filepath"
	"runtime"

	"github.com/ce-exp/backend/mod/report/model"
	"gorm.io/gen"
	"gorm.io/gorm"
)

type Querier interface {
}

func GenQuery(db *gorm.DB) {
	_, file, _, _ := runtime.Caller(0)

	g := gen.NewGenerator(gen.Config{
		OutPath: filepath.Dir(file) + "/internal/repository/query",
		Mode:    gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface,
	})

	g.UseDB(db)

	g.ApplyBasic(model.Report{}, model.Content{})

	g.ApplyInterface(func(Querier) {}, model.Report{})

	g.Execute()
}
